<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script>
    function t(){
        document.getElementById('t1').value = 't3';
    }
    </script>
</head>
<body>
    <input type="text" id="t1" value="t1">
    <input type="text" id="t1" value="t2">
    <button onclick="t()">ceshi</button>
</body>
</html>